package com.superm.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 员工类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Emp {
    private Integer eId;
    private String  eName;
    private String  ePassword;
    private String  eSex;
    private String eEmail;
    private String eAddress;
    private String ePhone;
    @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化
    @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化
    private String eBorn;
    private Department eDepartment;

    public Emp(Integer eId) {
        this.eId = eId;
    }

    @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化
    @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化
    private String eEntry;
    @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化
    @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化
    private String eDimission;
    @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化
    @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化
    private String eTime;
    private String eState;
    private String eSalt;
    /**
     * 用户的多个角色
     */
    private List<Role> roles;

    public Emp(String eName) {
        this.eName = eName;
    }

    public Integer geteId() {
        return eId;
    }

    public void seteId(Integer eId) {
        this.eId = eId;
    }

    public String geteName() {
        return eName;
    }

    public void seteName(String eName) {
        this.eName = eName;
    }

    public String getePassword() {
        return ePassword;
    }

    public void setePassword(String ePassword) {
        this.ePassword = ePassword;
    }

    public String geteSex() {
        return eSex;
    }

    public void seteSex(String eSex) {
        this.eSex = eSex;
    }

    public String geteEmail() {
        return eEmail;
    }

    public void seteEmail(String eEmail) {
        this.eEmail = eEmail;
    }

    public String geteAddress() {
        return eAddress;
    }

    public void seteAddress(String eAddress) {
        this.eAddress = eAddress;
    }

    public String getePhone() {
        return ePhone;
    }

    public void setePhone(String ePhone) {
        this.ePhone = ePhone;
    }

    public String geteBorn() {
        return eBorn;
    }

    public void seteBorn(String eBorn) {
        this.eBorn = eBorn;
    }

    public Department geteDepartment() {
        return eDepartment;
    }

    public void seteDepartment(Department eDepartment) {
        this.eDepartment = eDepartment;
    }

    public String geteEntry() {
        return eEntry;
    }

    public void seteEntry(String eEntry) {
        this.eEntry = eEntry;
    }

    public String geteDimission() {
        return eDimission;
    }

    public void seteDimission(String eDimission) {
        this.eDimission = eDimission;
    }

    public String geteTime() {
        return eTime;
    }

    public void seteTime(String eTime) {
        this.eTime = eTime;
    }

    public String geteState() {
        return eState;
    }

    public void seteState(String eState) {
        this.eState = eState;
    }

    public String geteSalt() {
        return eSalt;
    }

    public void seteSalt(String eSalt) {
        this.eSalt = eSalt;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }
}
